#!/bin/sh
sudo apt-get update
sudo apt-get install -y git libssl-dev libffi-dev build-essential libncurses5-dev 
sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get install -y qemu qemu-user-binfmt binfmt-support
sudo systemctl restart systemd-binfmt
sudo apt-get install -y gdb-multiarch
sudo apt-get install -y python3-pip python-pip 
sudo cp /usr/arm-linux-gnueabi/lib/ld-linux.so.3 /lib 
sudo cp /usr/arm-linux-gnueabi/lib/libgcc_s.so.1 /lib
sudo cp /usr/arm-linux-gnueabi/lib/libc.so.6 /lib
sudo pip install --upgrade pip pwntools
sudo pip3 install --upgrade pip3
mkdir -p $HOME/Tools
cd $HOME/Tools
git clone https://github.com/pwndbg/pwndbg
git clone https://github.com/JonathanSalwan/ROPgadget 
echo "set auto-load safe-path /" >> $HOME/.gdbinit
cd $HOME
cd Tools/pwndbg && ./setup.sh && cd .. && sudo apt-get clean && cd ROPgadget && sudo python3 setup.py install && cd $HOME/exploit_me
